#import path
export PATH=${PATH}:/usr/local/bin
#import what we have in bash_profile
source ~/.bash_profile
#check for oclint
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi

hash xctool &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "xctool not found, analyzing stopped"
exit 1
fi

xctool -workspace XCGraphics.xcworkspace -scheme XCGraphics clean
xctool -workspace XCGraphics.xcworkspace -scheme XCGraphics -reporter json-compilation-database:compile_commands.json build
oclint-json-compilation-database \
-e Pods \
-- -rc=LONG_LINE=200 \
-rc=NCSS_METHOD=60 \
-rc=LONG_METHOD=100 \
-rc=MINIMUM_CASES_IN_SWITCH=1 \
-report-type pmd \
-o oclint.xml \
-max-priority-1 1000 \
-max-priority-2 1000 \
-max-priority-3 1000 \